﻿using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using Service.BusinessLayer.Logic;
using Service.BusinessLayer.Entities;
using Service.DataAccess.DataAccessHelper;
namespace Service
{
    /// <summary>
    /// Summary description for WS_ChiPhi
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class WS_ChiPhi : System.Web.Services.WebService
    {
        XL_ChiPhi xlcp = new XL_ChiPhi();
        [WebMethod]
        public string layds()
        {
            string kq = "";
            kq = xlcp.layds().GetXml();
            return kq;
        }
        [WebMethod]
        public void them(string macp, string tencp)
        {
            ChiPhi cp = new ChiPhi(macp, tencp);
            xlcp.them(cp);
        }
        [WebMethod]
        public void sua(string macp, string tencp)
        {
            ChiPhi cp = new ChiPhi(macp, tencp);
            xlcp.sua(cp);
        }
        [WebMethod]
        public void xoa(string macp)
        {
            xlcp.xoa(macp);
        }
        [WebMethod]
        public string selectquery(string sql)
        {
            string kq = "";
            Helper help = new Helper();
            kq = help.SelectQueryByText(sql).GetXml();
            return kq;
        }
    }
}
